import http from './http'
// import axios from "axios"
// 根据token获取用户信息
export let getUserInfoApi = (params) => http.get(`/api/admin/token?token=${params}`)
// export let getUserInfoApi = () => http.pots(`/apr/api/admin/login`)
// export let getmancarApi = (params) => http.get(`/api/msg/notices/stat/occur_area?username=${params}`)
// 地图监测
// 设备情况
export let getDeviceApi = () => http.get(`/api/msg/animals/stat/device`)
export let getAndMsgApi = () => http.get(`https://qilihai.baohuqu.net:8080/api/iot/events/recentEvents`)
// 当日各区域人/车流量统计
// export let getAreaFlowApi = (params) => http.get(`/api/msg/notices/stat/occur_area?username=${params}`)
// 今日监测
export let getTodayMonitorApi = () => http.get(`/api/msg/animals/stat/today/level`)
// 今日各时段物种活跃度
export let getTodayActiveApi = () => http.get(`/api/msg/animals/stat/today/active`)
// 重点物种动态
export let getKeySpeciesApi = () => http.get(`/api/msg/animals/stat/level/active`)
// 今日动态
export let getTodayNoticesApi = (pageIndex , pageSize) => http.get(`/api/msg/animals/stat/today/notices?&pageIndex=${pageIndex}&pageSize=${pageSize}`)
// 动态统计
export let getDynamicStatApi = () => http.get(`/api/msg/animals/stat/today/animals`)
// 其他事件监控
export let getOtherEventApi = (params) => http.get(`/api/msg/notices/recent/ii_i?username=${params}`)
// 地图图层
export let getMapLayerApi = (params) => http.get(`/api/admin/layer/layerInfo?areaId=${params}`)
// WEB端获取设备接口
export let getWebDevicesApi = (params) => http.get(`/api/iot/devices/webDevices?manageSite=${params}&username=${params}`)
// 播放接口
// export let getplay = (params, channelNo) => http.get('https://qilihai.baohuqu.net:9090/api/play/start/' + params + '/' + channelNo)
export let getplay = (params, channelNo) => http.get('https://qilihai.baohuqu.net:9090/api/play/start/' + params + '/' + channelNo)
// 鸟类监测播放接口
export let plays = (params) => http.get('/api/iot/devices/play/' + params) 
// 设备监控动态
export let getDeviceMonitorApi = (params , pageIndex , pageSize) => http.get(`/api/msg/animals/device/active?deviceCode=${params}&pageIndex=${pageIndex}&pageSize=${pageSize}`)
// 设备各物种停留时间统计
export let getDeviceMonitorCountApi = ( year , channelNo ) => http.get(`/api/msg/animals/device/animal_day?paramYear=${year}&deviceCode=${channelNo}`)
// 设备事件分类统计
export let  getCategoryApi = (params , channelNo) => http.get(`/api/msg/animals/device/animal_name?paramYear=${params}&deviceCode=${channelNo}`)
// 设备事件分级统计
export let getLevelApi = (year , channelNo ,params ) => http.get(`/api/msg/animals/device/animal_level?paramYear=${year}&areaId=${channelNo}&deviceCode=${params}`)
// 设备各月份物种监测次数
export let getMonthApi = (year , channelNo  ) => http.get(`/api/msg/animals/device/animal_month?paramYear=${year}&deviceCode=${channelNo}`)
// 设备ICUN监测数量统计
export let getICUNApi = (year , channelNo ,params ) => http.get(`/api/msg/animals/device/endangered_level?paramYear=${year}&areaId=${channelNo}&deviceCode=${params}`)
// 设备每月事件数量
export let getDeviceMonthCountApi = (params , channelNo , year) => http.get(`/api/msg/notices/stat/device/month?username=${params}&deviceCode=${channelNo}&year=${year}`)
// 设备累计事件条数
// http://192.168.1.27:9999/api/msg/animals/device/animals?paramYear=2023&deviceCode=12011700091320000026
export let getDeviceTotalCountApi = (year , params) => http.get(`/api/msg/animals/device/animals?paramYear=${year}&deviceCode=${params}`)

// 监控画面
// 获取监控列表
// export let getMonitorListApi = (params , count) => http.get(`http://123.150.5.131:9090/api/device/query/devices?page=${params}&count=${count}`) // 七里海
export let getMonitorListApi = (params , count) => http.get(`https://qilihai.baohuqu.net:9090/api/device/query/devices?page=${params}&count=${count}`) // 七里海
// 监控列表二
export let getMonitorListApi2 = (num ,  params , count) => http.get(`https://qilihai.baohuqu.net:9090/api/device/query/tree/${num}?page=${params}&count=${count}&parentId=${num}&onlyCatalog=false`)
// 动物监测设备列表
// http://192.168.1.27:9999/api/iot/devices/animalDevices?manageSite=a62c04302e4d4e5682b75b4e03fd4238,a62c04302e4d4e5682b75b4e03fd4238
export let getAnimalMonitorListApi = (params ) => http.get(`/api/iot/devices/animalDevices?manageSite=${params}`)
// 云台控制
export let getPtzControlApi = (params , channelNo, dtn , type) => http.post(`https://qilihai.baohuqu.net:9090/api/ptz/control/${params}/${channelNo}?command=${dtn}&horizonSpeed=${type}&verticalSpeed=${type}&zoomSpeed=${type}`)
// export let getPtzControlApi = (params , channelNo, dtn , type) => http.post(`/api/ptz/control/${params}/${channelNo}?command=${dtn}&horizonSpeed=${type}&verticalSpeed=${type}&zoomSpeed=${type}`)
// 移动鸟类云台控制
// export let NewgetPtzControlApi2 = (params , dtn , type) => http.post(`http://123.150.5.131:8080/api/admin/gateDevice/controlling?cameraIndexCode=${params}&command=${dtn}&speed=${type}`)
export let NewgetPtzControlApi2 = (params , dtn , type) => http.post(`https://qilihai.baohuqu.net:8080/api/admin/gateDevice/controlling?cameraIndexCode=${params}&command=${dtn}&speed=${type}`)
// 移动鸟类云台控制停止
export let NewgetPtzControlApi3 = (params , dtn , type) => http.post(`https://qilihai.baohuqu.net:8080/api/admin/gateDevice/stop?cameraIndexCode=${params}&command=${dtn}&speed=${type}`)

// 统计分析
// 各事件统计
export let getEventStatApi = (params , year) => http.get(`/api/msg/notices/stat/notice_title?username=${params}&year=${year}`)
// 监测物种次数top10
export let getAnimalStatApi = (year) => http.get(`/api/msg/animals/stat/year/ten?paramYear=${year}`)
// 人员入侵各监控点次数统计
export let getPersonFlowApi = (params , year , titles) => http.get(`/api/msg/notices/stat/device_title?username=${params}&year=${year}&titles=${titles}`)
// 事件等级统计
export let getEventLevelApi = (params , year) => http.get(`/api/msg/notices/stat/notice_level?username=${params}&year=${year}`)
// 各监控点人车统计
export let getDeviceTargetApi = (params , year) => http.get(`/api/msg/notices/stat/device_target?username=${params}&year=${year}`)
// 统计分析中间地图
export let getDeviceYearApi = (params , year , titles) => http.get(`/api/msg/notices/stat/device_year?username=${params}&year=${year}&titles=${titles}`)
// 各月份消息监测次数统计
export let getMonthTitleApi = (params , year , titles) => http.get(`/api/msg/notices/stat/month_title?username=${params}&year=${year}&titles=${titles}`)
// 各监控点消息次数统计
export let getDeviceTitleApi = (params , year , titles) => http.get(`/api/msg/notices/stat/device_title?username=${params}&year=${year}&titles=${titles}`)
// 累计监测、总计
export let getYearAnimalApi = (params) => http.get(`/api/msg/animals/stat/year/animals?paramYear=${params}`)
// 监测物种次数top10
export let getYearAnimalTopApi = (params) => http.get(`/api/msg/animals/stat/year/ten?paramYear=${params}`)
// 各月份物种活跃度
export let getMonthAnimalActiveApi = (params) => http.get(`/api/msg/animals/stat/month/active?paramYear=${params}`)
// 重点物种迁徙规律
export let getMigrationApi = (params) => http.get(`/api/msg/animals/stat/migration?paramYear=${params}`)
// 保护等级统计
export let getAnimalLevelApi = (params , paramYear , manageSites) => http.get(`/api/msg/animals/stat/animals/level?areaId=${params}&paramYear=${paramYear}&manageSites=${manageSites}`)
// IUCN名录监测次数统计
export let getAnimalIucnApi = (params , paramYear , manageSites) => http.get(`/api/msg/animals/stat/endangered/level?areaId=${params}&paramYear=${paramYear}&manageSites=${manageSites}`)
// 动物留居统计
export let getAnimalResidentApi = (params , paramYear , manageSites) => http.get(`/api/msg/animals/stat/resident/type?areaId=${params}&paramYear=${paramYear}&manageSites=${manageSites}`)
// 获取鸟类名称
export let getBirdsNameApi = (params) => http.get(`/api/msg/animals/birds/names?areaId=${params}`)
// 物种各月份监测次数统计
export let getMonthSpeciesApi = (paramYear , speciesName) => http.get(`/api/msg/animals/month/species?paramYear=${paramYear}&speciesName=${speciesName}`)
// 物种各生境监测次数统计
export let getHabitatSpeciesApi = (params , paramYear,speciesName) => http.get(`/api/msg/animals/habitat?areaId=${params}&paramYear=${paramYear}&speciesName=${speciesName}`)
// 地图热力图
export let getMapHeatApi = (paramYear , speciesName) => http.get(`/api/msg/animals/locations?paramYear=${paramYear}&speciesName=${speciesName}`)